The GameboardSettingsOverlay widget is a prefab that has a standard setting menu and standard actions in that menu, so you can include the prefab to quickly have a settings menu. You just need to wire up the actions you would like on the button clicks.
The GameboardSettingsOverlay prefab requires the Gameboard GameObject to be present. Find the Gameboard menu at the top of the unity header and click "Add SDK" to add the Gameboard GameObject to your project. If you do not have the Gameboard menu options, see Gameboard SDK Access
Navigate in the Project explorer to Packages > Gameboard Unity > Runtime > Tools > Prefabs and look for the one named GameboardSettingsOverlay.prefab
And drag the prefab into your scene. You should see a menu in each corner of the screen.
You will notice the GameboardSettingsOverlay Script on the GameboardSettingsOverlay GameObject has a few customizable options.
Update any of the images to change the default menu images.
If you want drawers to be hidden when the menu is closed, and shown only when the menu is open, check the Hide Drawers
option.
The GameboardSettingsOverlay has some buttons, ones that open/close the menu and others that trigger events you can listen to to execute code specific to that button press.
OnSettingsPressed
event when pressed. You can use this to display you games settings.OnInstructionsPressed
event when pressed. You can use this to display your games instructions.OnCloseGamePressed
event when pressed. You can use this to either exit to your games menu, or exit the game completely.You can listen for the various events to trigger the desired action when the buttons are clicked. For example, if you have a method that exits the game, you can trigger that method when the OnCloseGamePressed
event is triggered with the following code.
public GameboardSettingsOverlay settings;
void Start()
{
settings.OnCloseGamePressed += OnExitGame;
}
void OnExitGame()
{
//Code that exits the game
}